import { folderJudge } from '../../../api/folder'
import { fileJudge, mindMapJudge } from '../../../api/file'

export function folderJudge1(parentId, name) {
  return new Promise(function(resolve, reject) {
    folderJudge(parentId, name)
      .then(result => {
        resolve(result)
      })
      .catch(err => {
        reject(err)
        console.log(err)
      })
  })
}

export function fileJudge1(parentId, name) {
  return new Promise(function(resolve, reject) {
    fileJudge(parentId, name)
      .then(result => {
        resolve(result)
      })
      .catch(err => {
        reject(err)
        console.log(err)
      })
  })
}

export function mindMapJudge1(parentId, name) {
  return new Promise(function(resolve, reject) {
    mindMapJudge(parentId, name)
      .then(result => {
        resolve(result)
      })
      .catch(err => {
        reject(err)
        console.log(err)
      })
  })
}
